home *** CD-ROM | disk | FTP | other *** search
- On my request to help out to code I got thid reply from Magnus Kollberg:
-
- <Well, I don't know what you code, but there is still some bits missing. I don't
- <know if they are 'small' though. :-)
-
- <The most important is the sound I think and we will also need some kind of
- <collision detection when you shot at monsters and when they fire back. I'm
- <not sure if this is a part of Fabrice work, but I don't think so.
-
- The sound as I understand this must be the ingame-sound-fx. And yes, that I
- could code. I have thougth about it today (While working hard!!!) and come
- up with this solution:
-
- Maximum of 4 or 8 mixed sounds. (Selecteble while playingprefably) Each of
- theese "channels" have one of theese tables:
- ds.l 1 ; address to start of sample
- ds.l 1 ; length of sample
- ds.l 1 ; current pos in sample
- ds.w 2 ; X and Y position of source of sound
- ds.b 1 ; Priority of sound
- even
- If the game engine wants to play a sound then give this info to in registers
- or in some table and call a subroutine wich will do like this: (Sorry I
- know you like C)
- procedure(sound);
- begin
- if antsounds<maxantsounds then
- begin
- inc(antsounds);
- soundtable[antsounds]:=sound;
- end;
- else
- begin
- c:=0;
- repeat
- inc(c);
- while(c<=maxsamples and sound.prior<soundtable[c].prior);
- if c<=maxsamples then soundtable[c]:=sound;
- end;
- end;
- That means first check if all channels are used, if not then just ocupy one
- for this sound, if they are then check if one of the sounds currently played
- have lower priority then the new one, if there is one then take over that
- channel, if all old sounds have higher priority then tough luck: this sound
- wont be payed!!!
-
- And now to the actual replay:
- Original, doom sound fx are sampled with ~11khz, Atari would love to replay
- those at 12.25kHz. Now some processor time will be lost by correcting to the
- right speed, but I do not personaly think we will need to. I have tested a
- few samples and the differenses are barely noticable... And original Bad
- Mood IWADs will be sampled at 12.25kHz, wont they?!?
- The second time loss/winning is having inerleaved replayed... Lets show
- what I mean. A comma separates the sample bytes (stereo not shown).
- A+B,C+D,A+B,C+D,A+... (Interleaved)
- A+B+C+D,A+B+C+D,A+... (Non interleaved)
- I do not know if interleaved will sound terible for 12.kHz or not... But if
- not then the time winning would be good.
-
- The replay code will land on nearly 200k of RAM, if I can cood it as I want
- to... This includes some tables for 3D sound and such, but I think I could
- get it very fast with some effort put into it. And that I will do!
-
- Before I begin, I want to know how you want the interface for adding new
- sounds to be played, and inprovements, tips, and most important if someone
- already have started on theese routines...
-
- Till then code calm...
-
- mvh
- PeyloW of T.O.Y.S.
-
- PS! By the way, the less sound currently played, the less processor time it
- will take ofcourse! :-)
-
-
-
-
-